package com.zhku.shop.feignclient;

import com.zhku.base.model.PageParams;
import com.zhku.base.model.PageResult;
import com.zhku.base.model.RestResponse;
import com.zhku.shop.model.dto.UpdateUserRoleDto;
import com.zhku.shop.model.po.TtUser;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;


@Slf4j
@Component
public class UserClientFactory implements FallbackFactory<UserClient> {
    @Override
    public UserClient create(Throwable throwable) {
        return new UserClient() {

            @Override
            public List<TtUser> shopUserList(String id) {
                log.debug("调用用户服务--查询当前店铺所有员工熔断异常:{}", throwable.getMessage());
                return null;
            }

            @Override
            public RestResponse updateUserRole(UpdateUserRoleDto updateUserRoleDto) {
                log.debug("调用用户服务--修改用户角色熔断异常:{}", throwable.getMessage());
                return null;
            }

            @Override
            public RestResponse updateUserShop(String id) {
                log.debug("调用用户服务--将用户所属店铺设置为空熔断异常:{}", throwable.getMessage());
                return null;
            }
        };
    }
}
